﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HMIS.Infrastructure.Core.Repositories;
using HMIS.Infrastructure.Core;
using HMIS.FrameWork.DomainBase;

namespace HMIS.Infrastructure.Facade
{
	public class DictionaryFacadeImpl : IDictionaryFacade
	{
		//注意这里
		private readonly IDictionaryRepository DictionaryRepository;
		public DictionaryFacadeImpl(IDictionaryRepository DictionaryRepository)
		{
			this.DictionaryRepository = DictionaryRepository;
		}

		#region IDictionaryFacade 成员

		public void SaveOrUpdate(HMIS.Infrastructure.Core.Dictionary entity)
		{
			DictionaryRepository.SaveOrUpdate(entity);
		}

		public HMIS.Infrastructure.Core.Dictionary GetDictionary(string id)
		{
			return DictionaryRepository.Get(id);
		}

		public HMIS.Infrastructure.Core.Dictionary LoadDictionary(string id)
		{
			return DictionaryRepository.Load(id);
		}

		public void DeleteDictionary(string id)
		{
			DictionaryRepository.Delete(id);
		}

		public IList<Dictionary> GetPlistAll()
		{
			return DictionaryRepository.GetPlistAll();
		}

		public IList<Dictionary> GetPlistByCategoryId(string id, int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
		{
			return DictionaryRepository.GetPlistByCategoryId(id, start, limit, sort, dir, filters, out total);
		}

		public IList<Dictionary> GetPlistByCategoryCode(string code, string query, int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
		{
			return DictionaryRepository.GetPlistByCategoryCode(code, query, start, limit, sort, dir, filters, out total);
		}

		public bool IsFieldExist(string fieldName, string fieldValue, string id)
		{
			return DictionaryRepository.IsFieldExist(fieldName, fieldValue, id);
		}

		#endregion
	}
}
